package com.gxy.learn.securityauth.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Description(JWT配置类)
 * author: Gao xueyong
 * Create at: 2021/12/1 下午9:06
 */
@Component
public class JwtProperties {
    /**
     * Request Headers ： Authorization
     */

    private static String header;

    /**
     * Base64对该令牌进行编码
     */
    private static String secret;

    /**
     * 令牌过期时间 此处单位/毫秒
     */
    private static Long timeout;
    /**
     * 加密类型
     */
    private static String encryptionype;

    @Value("${jwt.header}")
    public void setHeader(String header) {
        JwtProperties.header = header;
    }
    @Value("${jwt.secret}")
    public void setSecret(String secret) {
        JwtProperties.secret = secret;
    }
    @Value("${jwt.timeout}")
    public void setTimeout(Long timeout) {
        JwtProperties.timeout = timeout;
    }
    @Value("${jwt.encryptionype}")
    public void setEncryptionype(String encryptionype) {
        JwtProperties.encryptionype = encryptionype;
    }

    public static String getHeader() {
        return header;
    }

    public static String getSecret() {
        return secret;
    }

    public static Long getTimeout() {
        return timeout;
    }

    public static String getEncryptionype() {
        return encryptionype;
    }
}
